<%-- 
    Document   : form_dangnhap
    Created on : 17-10-2011, 20:17:39
    Author     : VuTienIT
--%>

<%@page import="java.util.ArrayList" %>
<%@page import="model.pojo.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
KhachHangPOJO ssDangNhap = null;
if(session.getAttribute("KhachHang")==null)
{
    ssDangNhap = new KhachHangPOJO();
    session.setAttribute("KhachHang", ssDangNhap);
}
else
{
    ssDangNhap = (KhachHangPOJO)session.getAttribute("KhachHang");
}
%>
<!DOCTYPE html>
                    
<div id="content_middle">
    <h3>Đăng nhập</h3>
<div class="detail_box">
  <div class="sidebar_box_content">
            <%
            if(ssDangNhap.getTenTruyCap()==null){
            %>
            <div id="login_box">
            <form id="form1" name="form1" method="post" action="DangNhap?Action=Login">
              <table width="100%" border="0">
                <tr>
                  <td align="left"><p>Tên đăng nhập</p>          </td>
                  <td width="70%" align="left" valign="middle">&nbsp;</td>
                </tr>
                <tr>
                  <td align="left"><input name="username" type="text" id="txt_field"/></td>
                  <td align="left" valign="middle">*</td>
                </tr>
                <tr>
                  <td align="left">&nbsp;</td>
                  <td align="left" valign="bottom">&nbsp;</td>
                </tr>
                <tr>
                  <td align="left">Mật khẩu </td>
                  <td align="left" valign="bottom">&nbsp;</td>
                </tr>
                <tr>
                  <td align="left"><label>
                    <input name="password" type="password" id="txt_field"/>
                  </label></td>
                  <td width="70%" align="left" valign="middle">*</td>
                </tr>
                <tr>
                  <td align="center">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                </tr>
                <tr>
                  <td align="left"><label>
                    <input type="submit" name="Submit" id="Submit" value="Đăng nhập" />
                    <br />
                    <input type="checkbox" name="cbNhoPass" id="cbNhoPass" />
                    Lưu thông tin
                  </label></td>
                  <td width="70%" align="left">&nbsp;</td>
                </tr>
                <tr>
                  <td align="center">
                      <%
                        if (request.getAttribute("Error") != null) {
                            out.println(request.getAttribute("Error"));
                        }
                        %>
                  </td>
                  <td width="70%" align="left">&nbsp;</td>
                </tr>
              </table>
          </form>
            </div>
            <%
           } else {
            %>
            <h4>Bạn đã đăng nhập rồi !</h4>
            <h4>Xin chào <a href="ThongTinKH?Page=info" /><b><%=ssDangNhap.getTenTruyCap()%></b></a></h4>
            <h4><a href="DangNhap?Action=Logout"/>Đăng xuất</a></h4>
            <%
           }
            %>
</div>
<p>&nbsp;</p>
</div>

<div class="cleaner"></div>
</div><!-- end of sidebar_box_content -->